let gm = (pos, ports_pos, facing, level) => {//获得控制器应该相连的其他机器
    switch (facing) {
        case "south":
            break;
        case "west":
            for (var key in ports_pos) {
                let a = ports_pos[key][0]
                let b = ports_pos[key][2]
                ports_pos[key][0] = -b;
                ports_pos[key][2] = a;
            }
            break;
        case "north":
            for (var key in ports_pos) {
                let a = ports_pos[key][0]
                let b = ports_pos[key][2]
                ports_pos[key][0] = -a;
                ports_pos[key][2] = -b;
            }
            break;
        case "east":
            for (var key in ports_pos) {
                let a = ports_pos[key][0]
                let b = ports_pos[key][2]
                ports_pos[key][0] = b;
                ports_pos[key][2] = -a;
            }
            break;
    }
    let ports = {}
    for (var key in ports_pos) {
        let mblock = level.getBlock(pos.x + ports_pos[key][0], pos.y + ports_pos[key][1], pos.z + ports_pos[key][2])
        let mx = CustomMachine.of(mblock)
        ports[key] = mx
    }
    return ports
}
global.getothermachine = gm